package com.szeldon.declatest.exec.plugins;

import java.util.Properties;

import com.szeldon.declatest.declaration.TestsSuiteDeclaration;
import com.szeldon.declatest.declaration.endpoints.EndpointDeclaration;
import com.szeldon.declatest.declaration.scenario.ScenarioDeclaration;
import com.szeldon.declatest.declaration.scenario.parts.DoScenarioStepPartDeclaration;
import com.szeldon.declatest.declaration.settings.SettingsDeclaration;
import com.szeldon.declatest.declaration.steps.ScenarioStepDeclaration;
import com.szeldon.declatest.exec.ITestSuiteExecutorListener;
import com.szeldon.declatest.exec.TestSuiteExecHistory;
import com.szeldon.declatest.exec.exceptions.ScenarioPartExecutionException;

/**
 * Interface for all executors of DoScenarioStep.
 * 
 * @author szeldon
 * 
 */
public interface IDoScenarioStepExecutorPlugin {

    /**
     * Returns a name of endpoint type supported by this plugin. For instance, plugin that supports executing a
     * DoScenarioPart for endpoint of WebService type, returns "WebService" in this method.
     * 
     * @return
     */
    public abstract String getSupportedEndpointType();

    /**
     * Executes given DoScenarioPart.
     * 
     * @param doScenarioStepPart
     * @param step
     * @param suite
     * @param properties
     * @param settings
     * @param endpoint
     * @param scenario
     * @param history
     * @param listener
     * @throws ScenarioPartExecutionException
     *             Thrown when there was a problem during an execution of given part.
     */
    public abstract void execute(DoScenarioStepPartDeclaration doScenarioStepPart, ScenarioStepDeclaration step,
            TestsSuiteDeclaration suite, Properties properties, EndpointDeclaration endpoint,
            SettingsDeclaration settings, ScenarioDeclaration scenario, TestSuiteExecHistory history,
            ITestSuiteExecutorListener listener) throws ScenarioPartExecutionException;

}
